package Temp;

import java.util.*;
import java.text.*;

public class DatumTest {
//Deze klasse is gemaakt om uit te zoeken hoe je met datums in java werkt	
public static void main(String[] argv)
{
	/*
	Calendar R1s = Calendar.getInstance();
	SimpleDateFormat sdf = new SimpleDateFormat("dd-mm-yyyy");
	try {R1s.setTime(sdf.parse("27-1-2010"));} catch(Exception e) {System.out.println("Foutje!");}
	
	Calendar R2s = Calendar.getInstance();
	System.out.println("Datum 1 is: " + R1s.toString());
	System.out.println("Datum 2 is: " + R2s.toString());
	System.out.println("Het verschil is: " + R2s.compareTo(R1s));
	
	*/
	Calendar R1s = Calendar.getInstance();
	Calendar R2s = Calendar.getInstance();
	SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy");
	try {R1s.setTime(sdf.parse("01-01-2010"));} catch(Exception e) {System.out.println("Foutje!");}
	try {R2s.setTime(sdf.parse("03-03-2010"));} catch(Exception e) {System.out.println("Foutje!");}
	
	
	long a = R1s.getTime().getTime();
	long b = R2s.getTime().getTime();
	long c =(b - a) / (24 * 60 * 60 * 1000);
	try {
		System.out.println(sdf.parse("20-01-2010").equals(sdf.parse("22-01-2010")));
	} catch (ParseException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
	
	
	
	
	
}
}
